/*
 * ParameterPlotter.java
 *
 * Created on November 13, 2007, 9:31 AM
 */

package curro;

import javax.swing.event.ChangeEvent;
import sequor.model.ParameterListModel;
import specto.euclidean2.Function2D;

/**
 *
 * @author  ae3263
 */
public class ParameterPlotter extends javax.swing.JFrame {
    
    String[][] functions = { { "f(x)=" , "a*sin(b*(x-c))+d", "x" } };
    Object[][] parameters = { { "a", 1.0 }, { "b", 2.0 }, { "c", Math.PI/2 }, { "d", -1.0 } };
        
    /** Creates new form ParameterPlotter */
    public ParameterPlotter() {
        initComponents();
       
        parameterListModel1=new ParameterListModel(parameters, settingsPanel2, functionPanel1);
        
        Function2D f1 = new Function2D(functionPanel1.getFunctionModel(0));
        plot2D4.add(f1);
        plot2D4.add(f1.getPointSlope());
        
        plot2D4.repaint();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        parameterListModel1 = new sequor.model.ParameterListModel();
        settingsPanel2 = new sequor.component.SettingsPanel();
        plot2D4 = new specto.euclidean2.Plot2D();
        functionPanel1 = new sequor.component.FunctionPanel(functions);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Function Plotter with Parameters");
        setMinimumSize(new java.awt.Dimension(600, 300));

        settingsPanel2.setPreferredSize(new java.awt.Dimension(152, 302));
        getContentPane().add(settingsPanel2, java.awt.BorderLayout.LINE_END);

        javax.swing.GroupLayout plot2D4Layout = new javax.swing.GroupLayout(plot2D4);
        plot2D4.setLayout(plot2D4Layout);
        plot2D4Layout.setHorizontalGroup(
            plot2D4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 636, Short.MAX_VALUE)
        );
        plot2D4Layout.setVerticalGroup(
            plot2D4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 373, Short.MAX_VALUE)
        );

        getContentPane().add(plot2D4, java.awt.BorderLayout.CENTER);
        getContentPane().add(functionPanel1, java.awt.BorderLayout.PAGE_END);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ParameterPlotter().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private sequor.component.FunctionPanel functionPanel1;
    private sequor.model.ParameterListModel parameterListModel1;
    private specto.euclidean2.Plot2D plot2D4;
    private sequor.component.SettingsPanel settingsPanel2;
    // End of variables declaration//GEN-END:variables
    
}
